from django.db import models
from db.base import BaseModel
# Create your models here.


class UserInfo(BaseModel):
    status_choices = (
        (1, "已认证"),
        (2, "未认证"),
        (3, "其他"),
    )
    user_name = models.CharField(max_length=64, verbose_name="用户名", unique=True, null=True)
    wechat_code = models.CharField(max_length=64, verbose_name="微信公众号的账号名字", null=True, unique=True)
    introduce = models.CharField(max_length=255, verbose_name="微信机构号简介", null=True)
    password = models.CharField(max_length=32, verbose_name="密码", null=True, default="123456")
    token = models.CharField(max_length=32, verbose_name="微信token", null=True, default="1234566")
    cookies = models.TextField(verbose_name="用户cookies")
    address = models.CharField(max_length=64, verbose_name="所在区域", null=True)
    profile_url = models.CharField(max_length=255, verbose_name="用户头像url", null=True)
    # user_type = models.SmallIntegerField(verbose_name="用户类型", choices=TYPE_CHOICES)
    authentication_status = models.SmallIntegerField(verbose_name="认证状态", choices=status_choices)
    last_login = models.DateTimeField(auto_now=True,verbose_name="最后登录时间")

    class Meta:
        db_table = "wechat_user"
        verbose_name = "微信公众号用户表"
        verbose_name_plural = verbose_name